package com.yykj.hospital.client.feign;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yykj.common.enums.HospitalOnlineTypeEnum;
import com.yykj.common.vo.PageData;
import com.yykj.common.vo.ResultVO;
import com.yykj.hospital.client.dto.*;
import com.yykj.hospital.client.dto.banci.DoctorAvailableAppointmentDTO;
import com.yykj.hospital.client.dto.bank.DoctorBankCashApplyDTO;
import com.yykj.hospital.client.dto.consultation.template.ConsultationVerifyDTO;
import com.yykj.hospital.client.dto.open.OpenDoctorDTO;
import com.yykj.hospital.client.fallback.HospitalAccountFallbackFactory;
import com.yykj.hospital.client.form.HospitalAdminEditForm;
import com.yykj.hospital.client.form.HospitalEditForm;
import com.yykj.hospital.client.form.OnlineOrderForm;
import com.yykj.hospital.client.form.banci.AppointmentOrderForm;
import com.yykj.hospital.client.form.bank.CashApplyCheckForm;
import com.yykj.hospital.client.form.consultation.ConsultationVerifyForm;
import com.yykj.hospital.client.form.open.OpenDoctorSearchForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "hospital-server", fallbackFactory = HospitalAccountFallbackFactory.class)
public interface HospitalServerFeignClient {
    @GetMapping("/api/proto/backstage/hospital/info/{id}")
    @ApiOperation(value = "医院信息")
    public HospitalDTO info(@PathVariable(name = "id") Integer id) ;

    @GetMapping("/api/proto/backstage/hospital/list")
    @ApiOperation(value = "医院列表")
    public PageData<HospitalDTO> getHospitalList(
            @RequestParam(name = "currentPage", defaultValue = "1") Integer currentPage,
            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
            @RequestParam(name = "name", defaultValue = "1") String name);

    @PostMapping("/api/proto/backstage/hospital/add")
    @ApiOperation(value = "医院创建")
    @ApiOperationSupport(ignoreParameters = {"id"})
    public HospitalDTO createHospital(@RequestBody HospitalEditForm hospitalEditForm);

    @PutMapping("/api/proto/backstage/hospital/edit")
    @ApiOperation(value = "医院修改")
    @ApiOperationSupport(ignoreParameters = {"name"})
    public HospitalDTO editHospital(@RequestBody HospitalEditForm hospitalEditForm);

    @DeleteMapping("/api/proto/backstage/hospital/delete/{id}")
    @ApiOperation(value = "医院删除")
    public void deleteHospital(@PathVariable("id") Integer id);

    @GetMapping("/api/proto/backstage/hospital/{hospitalId}/department/list")
    @ApiOperation(value = "获取医院科室列表")
    List<DepartmentListDTO> getHospitalDepartmentList(@PathVariable("hospitalId") Integer hospitalId);

    @PostMapping("/api/proto/backstage/hospital/admin/edit")
    @ApiOperation("医院总管理员--添加修改")
    @ApiOperationSupport(ignoreParameters = {"type", "roles"})
    public HospitalAdminDTO editAdmin(@RequestBody HospitalAdminEditForm form);

    @DeleteMapping("/api/proto/backstage/hospital/admin/delete/{adminId}")
    @ApiOperation("医院总管理员--删除")
    public void deleteAdmin(@PathVariable Integer adminId);

    @GetMapping("/api/proto/backstage/hospital/admin/list")
    @ApiOperation("医院总管理员--列表")
    public List<HospitalAdminListDTO> listHospitalAdmin(@RequestParam(name = "hospitalId") Integer hospitalId,
                                                        @RequestParam(name = "username", required = false) String username,
                                                        @RequestParam(name = "keyword", required = false) String keyword);


    @GetMapping("/api/proto/backstage/hospital/hot/department")
    public List<HospitalDepartmentDTO> listHostDepartment(@RequestParam(name = "hospitalId") Integer hospitalId);


    @GetMapping("/api/proto/hospital/doctor/info/{doctorId}")
    public DoctorDTO info(@PathVariable String doctorId);


    @GetMapping("/api/proto/hospital/config/info/{hospitalId}")
    @ApiOperation("医院配置")
    public HospitalConfigInfo hospitalConfigInfo(@PathVariable Integer hospitalId);

    @GetMapping("/api/proto/hospital/doctor/online/config/{doctorId}")
    @ApiOperation("医生在线问诊价格配置")
    public List<DoctorOnlinePriceSettingDTO> doctorOnlineConfigInfo(@PathVariable String doctorId);



    @GetMapping("/api/proto/hospital/check/appointment/cnt")
    @ApiOperation("预约挂号 -- 检查医生是否还有号可约 ")
    public DoctorAvailableAppointmentDTO checkAvailableAppointmentCnt(@RequestParam(name = "doctorId") String doctorId,
                                                                      @RequestParam(name = "appointId") Integer appointId);

    @PutMapping("/api/proto/hospital/change/appointment/cnt")
    @ApiOperation("预约挂号 -- 修改库存")
    public DoctorAvailableAppointmentDTO changeAvailableAppointmentCnt(@RequestBody AppointmentOrderForm form);

    @GetMapping("/api/proto/hospital/check/online/cnt")
    @ApiOperation("在线问诊 -- 检查医生是否还有号可约 ")
    public DoctorAvailableOnlineDTO checkAvailableOnlineCnt(@RequestParam(name = "doctorId") String doctorId,
                                                            @RequestParam(name = "appointId") Integer appointId,
                                                            @RequestParam(name = "type") HospitalOnlineTypeEnum type);

    @PutMapping("/api/proto/hospital/change/online/cnt")
    @ApiOperation("在线问诊 -- 修改库存")
    public DoctorAvailableOnlineDTO changeAvailableOnlineCnt(@RequestBody OnlineOrderForm form);

    @ApiOperation("会诊是否需要后台审核")
    @PostMapping("/api/proto/hospital/consultation/check")
    public List<ConsultationVerifyDTO> consultationCheck(@RequestBody ConsultationVerifyForm form);

    @ApiOperation("提现申请--审核拒绝")
    @PostMapping("/api/proto/hospital/doctor/cash/refused")
    public void refuseDoctorCashApply(@RequestBody CashApplyCheckForm form);


    @ApiOperation("提现申请 -- 审核通过")
    @PostMapping("/api/proto/hospital/doctor/cash/pass")
    public void passDoctorCashApply(@RequestBody CashApplyCheckForm form);
    @ApiOperation("提现申请 -- 列表 ")
    @GetMapping("/api/proto/hospital/doctor/cash/list")
    public PageData<DoctorBankCashApplyDTO> listDoctorCashApply(@RequestParam(name = "orderNo",required = false) String orderNo,
                                                                @RequestParam(name = "hospitalId",required = false) Integer hospitalId,
                                                                @RequestParam(name = "doctorId",required = false) String doctorId,
                                                                @RequestParam(name = "doctorName",required = false) String doctorName,
                                                                @RequestParam(name = "bankCardNo",required = false) String bankCardNo,
                                                                @RequestParam(name = "startTime",required = false) String startTime,
                                                                @RequestParam(name = "endTime",required = false) String endTime,
                                                                @RequestParam(name = "status",required = false) Integer status,
                                                                @RequestParam(name = "currentPage",defaultValue = "1") Integer currentPage,
                                                                @RequestParam(name = "pageSize",defaultValue = "10") Integer pageSize );



    @PostMapping("/open/api/proto/doctor/search")
    public ResultVO openSearchDoctor(@RequestBody OpenDoctorSearchForm form);


    @GetMapping("/open/api/proto/officer/list")
    @ApiOperation("职称--列表")
    public ResultVO<List<HospitalOfficerDTO>> listHospitalOfficer(@RequestParam(name = "hospitalId") Integer hospitalId);

    @GetMapping("/open/api/proto/doctor/info/{doctorId}")
    @ApiOperation("医生详情")
    public ResultVO<OpenDoctorDTO> doctorInfo(@PathVariable String doctorId);


}
